package com.itheima02.day02test;

/**
 * @author 刘全
 * @date 2021/7/16
 */
//定义饲养员类
public class Breeder {
    public void breed(Animals a) {
        a.drink();
        a.eat();
        if (a instanceof Dog) {
            Dog d = (Dog) a;
            d.swimming();
        } else if (a instanceof Frog) {
            Frog f = (Frog) a;
            f.swimming();
        }
    }
}
